<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %> 
<%@ page import="data.BitacoraDataMapper" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="arivp89.css" media="screen" />
        <title>Registro de Notas</title>
    </head>
    <body>
        <%
        BitacoraDataMapper mapper = new BitacoraDataMapper();
        ResultSet rs = mapper.obtenerListaClase(request.getSession().getAttribute("BitID").toString());
        %>
        <h1>Registro de Notas</h1><br>
        <table border="1" cellspacing="3" cellpadding="2">
            <thead>
                <tr>
                    <th><b>Carnet</b></th>
                    <th><b>Nombre</b></th>
                    <th><b>Primer Apellido</b></th>
                    <th><b>Segundo Apellido</b></th>
                    <th><b>Nota Final</b></th>
                </tr>
            </thead>
            <tbody>
                <%
                    if(rs!=null){
                        while(rs.next()){
                                out.println("<tr>");
                                out.println("<td>"+rs.getString(1) +"</td>");
                                out.println("<td>"+rs.getString(2) +"</td>");
                                out.println("<td>"+rs.getString(3) +"</td>");
                                out.println("<td>"+rs.getString(4) +"</td>");
                                out.println("<td>"+mapper.obtenerNotaFinal(request.getSession().getAttribute("BitID").toString(), rs.getString(1)) +"</td>");
                                out.println("</tr>");
                        }
                    }
                %>
            </tbody>
        </table><br><br>
        <html:link page="/ModificarBitacoraIndex.jsp"><- Atrás</html:link>
        <div id="bottom">
            Creado por: Alejandro Rivera, Franklin Alfaro. ECCI, UCR.
            <br>
        </div>
    </body>
</html>
